package com.hong.garen.dao.Pressure;
/**
 * Created by GarenHong  on 2023/2/25.
 */
import com.hong.garen.conn.connection;
import com.hong.garen.pojo.Pressure;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class pressureDaoImpl implements pressureDao {
    @Override
    public void insertData(Pressure pressure) {
        String sql = "INSERT INTO pressure VALUES(?,?)";
        connection connection = new connection();
        try (
                Connection conn = connection.getConnection2();
                PreparedStatement pstmt = conn.prepareStatement(sql);
        ) {
            pstmt.setInt(1,pressure.getId());
            pstmt.setString(2,pressure.getValue());
            pstmt.executeUpdate();
            connection.destroy();


        }
        catch (SQLException e) {
            e.printStackTrace();
        }

        }


}

